let graph = new joint.dia.Graph;

let paper = new joint.dia.Paper({
    el:$("#paper"),
    width:1000,
    height:600,
    gridSize:10,
    model:graph
});

let source = new joint.shapes.standard.Rectangle();
source.position(50,50);
source.resize(100,50);
source.attr("label/text","开始");

let target = source.clone();
target.position(50,250);
target.attr("label/text","结束");

let target2 = source.clone();
target2.position(50,150);
target2.attr("label/text","中间");

//创建节点直接连接关系
let link = new joint.shapes.standard.Link();
link.source(source)
link.target(target2)

let link2 = new joint.shapes.standard.Link();
link2.source(target2)
link2.target(target)

//渲染节点关系图
graph.addCells([source,target,link2,target2,link]);